﻿@{ var home = @Model.AncestorOrSelf(); }
@{ var menuItem = "<li {2}><a href=\"{0}\">{1}</a></li>"; }
@{ string activeClass = string.Empty; }
<ul>
  @if(Model.Id == home.Id)
    {
     <li id="first" class="active"><a href="@home.Url">@home.Name</a></li>
    }
   else
    {
     <li id="first"><a href="@home.Url">@home.Name</a></li>
    }
  

    @foreach(var node in home.Children)
     {
      if(node.umbracoNaviHide == 0)
          {
            if(Model.Id == node.Id)
              {
               activeClass = "class=\"active\"";
              }
             else
              {
               activeClass = string.Empty;
              }
           
            @Html.Raw(string.Format(menuItem , node.Url, node.Name, activeClass));
          }
     }

</ul>
